<link href="/assets/home/css/center.css" rel="stylesheet" />

<!-- 头部 -->
<div class="user">
    <div class="avatar wow fadeInUp">
        <img src="{$LoginUser['avatar']}" />
    </div>

    <div class="nickname wow fadeInUp" data-wow-delay="100ms">{$LoginUser['nickname']}</div>
</div>

<!-- 菜单 -->
<div class="menulist wow fadeInUp" data-wow-delay="300ms">
    <a href="{:url('home/business/profile')}" class="item">
        <span>基本资料</span>
        <img src='/assets/home/images/row.png' />
    </a>
    <a href="{:url('home/business/email')}" class="item" onclick="email(event)">
        <span>邮箱认证</span>
        <img src='/assets/home/images/row.png' />
    </a>
    <a href="{:url('home/subject/order')}" class="item">
        <span>我的订单</span>
        <img src='/assets/home/images/row.png' />
    </a>
    <a href="{:url('home/business/record')}" class="item">
        <span>我的消费</span>
        <img src='/assets/home/images/row.png' />
    </a>
    <a href="{:url('home/pay/pay')}" class="item">
        <span>充值</span>
        <img src='/assets/home/images/row.png' />
    </a>
    <a href="{:url('home/business/contact')}" class="item">
        <span>联系我们</span>
        <img src='/assets/home/images/row.png' />
    </a>
    <a id="logout" href="javascript:void(0)" class="item">
        <span>退出</span>
        <img src='/assets/home/images/row.png' />
    </a>
</div>

<!-- 引入公共底部 -->
{include file='common/footer' /}

<script>
    $("#logout").click(function () {
        mui.confirm("确认是否退出登陆？", '退出登陆', ['确认', '取消'], function (e) {
            if (e.index == 0) {
                $.ajax({
                    type: 'POST',
                    url: `{:url('home/index/logout')}`,
                    dataType: 'json',
                    success: function (res) {
                        if (res.code == 1) {
                            mui.toast(res.msg)
                            setTimeout(() => {
                                location.href = `{:url('home/index/login')}`
                            }, 2000)
                        }
                    }
                })

            }
        })
    })
    function email(e){
        let auth=`{$LoginUser['auth']}`
        if(auth==1){
            e.preventDefault();
            mui.toast('已经验证邮箱了', {duration: 3000})
        }
      
    }
</script>